<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>

<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
	<head>
		<title>My JSP 'shippedBoxStatus.jsp' starting page</title>
	</head>
	
	<body>
		<h3>箱子状态查询</h3>
		<br>
		<div class="row">
			<form action="#" method="post" id="search_boxCode">
				<div class="span12">
					&nbsp;&nbsp;&nbsp;&nbsp;
					请输入箱子编码：
					<input type="text" name="boxCode" class="input-medium" value="${param.boxCode}" id="shippedBoxStatusSearchBoxCode">
					<button type="button" class="btn btn-primary" id="submit_boxCode">
						查询
					</button>
				</div>
				<br><br><br>
			</form>
		
			<script type="text/javascript">
				$(document).ready(function(){
					var boxCode = $("#shippedBoxStatusSearchBoxCode").val() + "";
					if (boxCode.trim() == "") {
						$("#contentTable").hide();
					}
				});

				$("#submit_boxCode").click(function() {
					init();
				});	

				function init() {
					var boxCode = $("#shippedBoxStatusSearchBoxCode").val() + "";
					if (boxCode.trim() == "") {
						$("#shippedBoxStatusSearchBoxCode").attr("name", "");
					}
			        $("#search_boxCode").attr("action", "${ctx}/shippedBox/shippedBoxStatusList");
					$("#search_boxCode").submit();
					$("#shippedBoxStatusSearchBoxCode").attr("name", "boxCode");
				}
			</script>
		</div>
		
		<table id="contentTable" class="table table-condensed">
			<thead>
				<tr>
					<th>
						货物状态
					</th>
					<th>
						所属批次
					</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>
						<c:if test="${shippedBox.transitStatus eq 'init'}">初始化状态</c:if>
						<c:if test="${shippedBox.transitStatus eq 'send_incar'}">已送货上车</c:if>
						<c:if test="${shippedBox.transitStatus eq 'send_outcar'}">已送货下车</c:if>
						<c:if test="${shippedBox.transitStatus eq 'inair'}">已空运发货</c:if>
						<c:if test="${shippedBox.transitStatus eq 'accept_incar'}">已接货上车</c:if>
						<c:if test="${shippedBox.transitStatus eq 'instore'}">已网点入库</c:if>
						<c:if test="${shippedBox.transitStatus eq 'outstore'}">已领用出库</c:if>
						<c:if test="${shippedBox.transitStatus eq 'bag_in'}">已经入袋</c:if>
					</td>
					<td>
						${shippedBox.batchCode}
					</td>
				</tr>
			</tbody>
		</table>
	</body>
</html>